package cn.demomaster.quickui_sample.ui.fragment.component;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.demomaster.quickcompat.widget.button.QuickButton;
import com.demomaster.quickcompat.widget.layout.QuickSurroundLayout;
import com.demomaster.quickcompat.widget.layout.QuickSurroundWrapLayout;

import cn.demomaster.quickrouter.fragment.QuickFragment;
import cn.demomaster.quickui.annotation.ActivityPager;
import cn.demomaster.quickui.annotation.ResType;
import cn.demomaster.quickui_sample.R;


/**
 * Squirrel桓
 * 2018/8/25
 */
@ActivityPager(name = "环绕布局", preViewClass = QuickButton.class,resType = ResType.Resource )//,iconRes = R.drawable.ic_audio)
public class RoundMenuFragment extends QuickFragment {

    @Override
    public View onGenerateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View mView = inflater.inflate(R.layout.fragment_layout_round_menu, null);
        return mView;
    }
    QuickSurroundLayout surroundLayout;
    QuickSurroundLayout surroundLayout2;
    QuickSurroundWrapLayout surroundLayout3;
    Button btn_06;
    Button button_05;
    @Override
    public void initView(View rootView) {
        surroundLayout = rootView.findViewById(R.id.surroundLayout);
        surroundLayout.setOnClickListener(v -> {
            if (surroundLayout.isShowing()) {
                surroundLayout.stopAnimation();
            } else {
                surroundLayout.startAnimation();
            }
        });
        surroundLayout2 = rootView.findViewById(R.id.surroundLayout2);
        btn_06 = rootView.findViewById(R.id.btn_06);
        btn_06.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //QdToast.show(mContext,"click");
                if (surroundLayout2.isShowing()) {
                    surroundLayout2.stopAnimation();
                } else {
                    surroundLayout2.startAnimation();
                }
            }
        });

        surroundLayout3 = rootView.findViewById(R.id.surroundLayout3);
        button_05 = rootView.findViewById(R.id.button_05);
        button_05.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //QdToast.show(mContext,"click");
                if (surroundLayout3.isShowing()) {
                    surroundLayout3.stopAnimation();
                } else {
                    surroundLayout3.startAnimation();
                }
            }
        });
       }
}